{include file="common/head"}
<head>
<title>注册</title>

<style type="text/css">
  .row{margin: 10px 0;}
  label{width: 18%;display: inline-block;}
  .form-control{display:inline-block;width: 80%;}  
</style>
</head>
<body style="">
    <div class="container m-3 p-3 " style="max-width: 600px;margin-left:24%;border:2px solid #f60;"  >

    <div class="text-center fs-2">用户注册</div>
    
    <form method="post" action="/index.php/user/user_add">

      <div class="row">
        <div class="col-2">登录帐号:</div>
        <div class="col">
          <input type="text" class="form-control" id="uid" name="uid" value="" placeholder="(登录帐号)" />
        </div>
      </div>

      <div class="row">
        <div class="col-2">姓名:</div>
        <div class="col">
        <input type="text" class="form-control" id="name" name="name" value="" placeholder="姓名" />
        </div>
      </div>

      <div class="row">
        <div class="col-2">手机号码:</div>
        <div class="col">
        <input type="text" class="form-control" id="mobile" name="mobile" value="" placeholder="手机号码" />
      </div>
      </div>

      <div class="row">
        <div class="col-2">密码:</div>
        <div class="col">
        <input type="text" class="form-control" id="pwd" name="pwd" value="" placeholder="密码" />
      </div>
      </div>

      <div class="row">
        <div class="col-2">确认密码:</div>
        <div class="col">
        <input type="text" class="form-control" id="pwd2" name="pwd2" value="" placeholder="确认密码" />
      </div>
      </div>


      <div class="row" >
        <div class="col-2">验证码:</div>

        <div class="col-8">
          <div class="input-group">
            <input class="form-control" type="text" id="verify" name="verify" />
            <img src="/index.php/login/verify" id="validate" onclick="verifyReload();"
              style="margin-left: -6px;border-radius: 4px;border: 1px solid #ccc;" />
          </div>
        </div>
      </div>      

      <div class="text-center">
        <button  type="button" class="btn btn-primary" onclick="doSave()">提交注册</button>
      </div>

    </form>
    </div>

<script type="text/javascript">
    function doSave(){
      if(!$("#uid").val()) {
        layer.msg("无效的账号!");
        return 0;
      } 
      if(!$("#name").val()) {
        layer.msg("无效的姓名!");
        return 0;
      } 
   
      $('form').submit();

    }

    $(document).ready(function () {
      verifyReload();
    })

    function verifyReload() {
      validate = document.getElementById('validate');
      validate.src = "";
      validate.src = "/login/verify/temp/" + new Date().getTime().toString(36);
    }

    setInterval(verifyReload,30000)

</script>


</body>
</html>
